<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    .box {
      width: 500px;
      height: 500px;
      background-color: pink;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .item {
      width: 100px;
      height: 100px;
      background-color: red;
    }
  </style>
  <body>
    <div class="box">
      <div class="item">这是要居中的盒子</div>
    </div>
  </body>
</html>
